package com.github.cosycode.imgtool.util;

import lombok.extern.slf4j.Slf4j;

public class RuntimeUtils {

    public static void endNotify() {
        Runtime.getRuntime().addShutdownHook(new ShutDownHookThread());
    }

    @Slf4j
    public static class ShutDownHookThread extends Thread {
        @Override
        public void run() {
            // 自行关闭程序, 实现资源的清理, 关闭流
            log.warn("调用了程序终止的钩子");
        }
    }


}
